import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<OrderDetailListViewState> buildReducer() {
  return asReducer(
    <Object, Reducer<OrderDetailListViewState>>{
      OrderDetailListViewAction.action: _onAction,
      OrderDetailListViewAction.onGetData: _onGetData,
    },
  );
}

OrderDetailListViewState _onAction(
    OrderDetailListViewState state, Action action) {
  final OrderDetailListViewState newState = state.clone();
  return newState;
}

OrderDetailListViewState _onGetData(
    OrderDetailListViewState state, Action action) {
  final OrderDetailListViewState newState = state.clone()
    ..payTypeItem = action.payload;
  return newState;
}
